Map 

- It is a interface in java.util package.
- It doesnot belongs to collection bcoz it stores values based on key & value pair. And it internally contains collection
Ex: Set, Collection (interface)

- It has 2 classes:
 (a) HashMap
 (b) TreeMap
-Here the values are stored based on Key & Value pair
- Key cannot be duplicate but value can be duplicate.
- It stores values based on HashCode logic.
- It internally contains Set<>
- It doesnot supports index.


Q: How to create a object to HashMap?
Ans:
Map<String,String> oMap = new HashMap<String,String>();
HashMap<String,String> oMap=new HashMap<String,String>();

	---Raw approach---
Map oMap = new HashMap();
HashMap oMap=new HashMap();


Q: Methods in HashMap?
(1) put()
(2) get()
(3) containsKey()
(4) containsValue()
(5) remove() - Overloaded
(6) keySet() - It returns Set interface
(7) values() - It returns Collection interface
(8) entrySet() - It returns Set interface
(9) clear()
(10) equals()
(11) forEach()
(12) isEmpty()
(13) putAll()
(14) replace() - Overloaded
(15) size()
(16) Primitives
(17) Raw approach


Note: All the methods in HashMap are same in TreeMap as well. Only the difference is:


Q: Difference between HashMap & TreeMap
Ans:	
	HashMap						TreeMap
1. Key can be null			1. Key can't be null
2. No sorting by default	2. Sorts asc by default
3. Its faster than TreeMap	3. Its slower than HashMap
4.  ?						4. ?

